import Vue from 'vue'
import vuex from 'vuex'
Vue.use(vuex)


export default new vuex.Store({
    state: {
        token: '',
        guidePath: '',
        remainTime: '',
        platform:'',
        iosTrue:true
    },
    mutations: {
        set_token(state, token) {
            state.token = token
            localStorage.token = token
        },
        set_guide(state, guidePath) {
            state.guidePath = guidePath
            localStorage.guidePath = guidePath
        },
        reset_token(state) {
            state.token = ''
        },
        set_remainTime(state, remainTime) {
            state.remainTime = remainTime
            localStorage.remainTime = remainTime
        },
        // 设置支付类型
        set_platform(state,platform){
            state.platform = platform
        }
    },
    getters: {
        getRemainTime: state => {
            return state.remainTime
        }
    },
})